home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / ecc-121.lha / ecc-1.2.1 / configure next >
Text File  |  1993-01-19  |  8KB  |  245 lines

  1. #!/bin/sh
  2. # Guess values for system-dependent variables and create Makefiles.
  3. # Generated automatically using autoconf.
  4. # Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
  5.  
  6. # This program is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 2, or (at your option)
  9. # any later version.
  10.  
  11. # This program is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. # GNU General Public License for more details.
  15.  
  16. # You should have received a copy of the GNU General Public License
  17. # along with this program; if not, write to the Free Software
  18. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19.  
  20. # Usage: configure [--srcdir=DIR] [--host=HOST] [--gas] [--nfp] [--no-create]
  21. #        [--prefix=PREFIX] [--exec-prefix=PREFIX] [--with-PACKAGE] [TARGET]
  22. # Ignores all args except --srcdir, --prefix, --exec-prefix, --no-create, and
  23. # --with-PACKAGE unless this script has special code to handle it.
  24.  
  25.  
  26. for arg
  27. do
  28.   # Handle --exec-prefix with a space before the argument.
  29.   if test x$next_exec_prefix = xyes; then exec_prefix=$arg; next_exec_prefix=
  30.   # Handle --host with a space before the argument.
  31.   elif test x$next_host = xyes; then next_host=
  32.   # Handle --prefix with a space before the argument.
  33.   elif test x$next_prefix = xyes; then prefix=$arg; next_prefix=
  34.   # Handle --srcdir with a space before the argument.
  35.   elif test x$next_srcdir = xyes; then srcdir=$arg; next_srcdir=
  36.   else
  37.     case $arg in
  38.      # For backward compatibility, also recognize exact --exec_prefix.
  39.      -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* | --exec=* | --exe=* | --ex=* | --e=*)
  40.     exec_prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  41.      -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- | --exec | --exe | --ex | --e)
  42.     next_exec_prefix=yes ;;
  43.  
  44.      -gas | --gas | --ga | --g) ;;
  45.  
  46.      -host=* | --host=* | --hos=* | --ho=* | --h=*) ;;
  47.      -host | --host | --hos | --ho | --h)
  48.     next_host=yes ;;
  49.  
  50.      -nfp | --nfp | --nf) ;;
  51.  
  52.      -no-create | --no-create | --no-creat | --no-crea | --no-cre | --no-cr | --no-c | --no- | --no)
  53.         no_create=1 ;;
  54.  
  55.      -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
  56.     prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  57.      -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
  58.     next_prefix=yes ;;
  59.  
  60.      -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=* | --s=*)
  61.     srcdir=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  62.      -srcdir | --srcdir | --srcdi | --srcd | --src | --sr | --s)
  63.     next_srcdir=yes ;;
  64.  
  65.      -with-* | --with-*)
  66.        package=`echo $arg|sed 's/-*with-//'`
  67.        # Delete all the valid chars; see if any are left.
  68.        if test -n "`echo $package|sed 's/[-a-zA-Z0-9_]*//g'`"; then
  69.          echo "configure: $package: invalid package name" >&2; exit 1
  70.        fi
  71.        eval "with_`echo $package|sed s/-/_/g`=1" ;;
  72.  
  73.      *) ;;
  74.     esac
  75.   fi
  76. done
  77.  
  78. trap 'rm -f conftest* core; exit 1' 1 3 15
  79.  
  80. rm -f conftest*
  81. compile='${CC-cc} $DEFS conftest.c -o conftest $LIBS >/dev/null 2>&1'
  82.  
  83. # A filename unique to this package, relative to the directory that
  84. # configure is in, which we can look for to find out if srcdir is correct.
  85. unique_file=ecc.c
  86.  
  87. # Find the source files, if location was not specified.
  88. if test -z "$srcdir"; then
  89.   srcdirdefaulted=yes
  90.   # Try the directory containing this script, then `..'.
  91.   prog=$0
  92.   confdir=`echo $prog|sed 's%/[^/][^/]*$%%'`
  93.   test "X$confdir" = "X$prog" && confdir=.
  94.   srcdir=$confdir
  95.   if test ! -r $srcdir/$unique_file; then
  96.     srcdir=..
  97.   fi
  98. fi
  99. if test ! -r $srcdir/$unique_file; then
  100.   if test x$srcdirdefaulted = xyes; then
  101.     echo "configure: Can not find sources in \`${confdir}' or \`..'." 1>&2
  102.   else
  103.     echo "configure: Can not find sources in \`${srcdir}'." 1>&2
  104.   fi
  105.   exit 1
  106. fi
  107. # Preserve a srcdir of `.' to avoid automounter screwups with pwd.
  108. # But we can't avoid them for `..', to make subdirectories work.
  109. case $srcdir in
  110.   .|/*|~*) ;;
  111.   *) srcdir=`cd $srcdir; pwd` ;; # Make relative path absolute.
  112. esac
  113.  
  114. if test -z "$CC"; then
  115.   echo checking for gcc
  116.   saveifs="$IFS"; IFS="${IFS}:"
  117.   for dir in $PATH; do
  118.     test -z "$dir" && dir=.
  119.     if test -f $dir/gcc; then
  120.       CC="gcc"
  121.       break
  122.     fi
  123.   done
  124.   IFS="$saveifs"
  125. fi
  126. test -z "$CC" && CC="cc"
  127.  
  128. # Find out if we are using GNU C, under whatever name.
  129. cat > conftest.c <<EOF
  130. #ifdef __GNUC__
  131.   yes
  132. #endif
  133. EOF
  134. ${CC-cc} -E conftest.c > conftest.out 2>&1
  135. if egrep yes conftest.out >/dev/null 2>&1; then
  136.   GCC=1 # For later tests.
  137. fi
  138. rm -f conftest*
  139.  
  140. # Make sure to not get the incompatible SysV /etc/install and
  141. # /usr/sbin/install, which might be in PATH before a BSD-like install,
  142. # or the SunOS /usr/etc/install directory, or the AIX /bin/install,
  143. # or the AFS install, which mishandles nonexistent args.  (Sigh.)
  144. if test -z "$INSTALL"; then
  145.   echo checking for install
  146.   saveifs="$IFS"; IFS="${IFS}:"
  147.   for dir in $PATH; do
  148.     test -z "$dir" && dir=.
  149.     case $dir in
  150.     /etc|/usr/sbin|/usr/etc|/usr/afsws/bin) ;;
  151.     *)
  152.       if test -f $dir/install; then
  153.     if grep dspmsg $dir/install >/dev/null 2>&1; then
  154.       : # AIX
  155.     else
  156.       INSTALL="$dir/install -c"
  157.       INSTALL_PROGRAM='$(INSTALL)'
  158.       INSTALL_DATA='$(INSTALL) -m 644'
  159.       break
  160.     fi
  161.       fi
  162.       ;;
  163.     esac
  164.   done
  165.   IFS="$saveifs"
  166. fi
  167. INSTALL=${INSTALL-cp}
  168. INSTALL_PROGRAM=${INSTALL_PROGRAM-'$(INSTALL)'}
  169. INSTALL_DATA=${INSTALL_DATA-'$(INSTALL)'}
  170.  
  171. if test -n "$prefix"; then
  172.   test -z "$exec_prefix" && exec_prefix='${prefix}'
  173.   prsub="s%^prefix\\([     ]*\\)=\\([     ]*\\).*$%prefix\\1=\\2$prefix%"
  174. fi
  175. if test -n "$exec_prefix"; then
  176.   prsub="$prsub
  177. s%^exec_prefix\\([     ]*\\)=\\([     ]*\\).*$%\
  178. exec_prefix\\1=\\2$exec_prefix%"
  179. fi
  180.  
  181. trap 'rm -f config.status; exit 1' 1 3 15
  182. echo creating config.status
  183. rm -f config.status
  184. cat > config.status <<EOF
  185. #!/bin/sh
  186. # Generated automatically by configure.
  187. # Run this file to recreate the current configuration.
  188. # This directory was configured as follows,
  189. # on host `(hostname || uname -n) 2>/dev/null`:
  190. #
  191. # $0 $*
  192.  
  193. for arg
  194. do
  195.   case "\$arg" in
  196.     -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
  197.     exec /bin/sh $0 $* ;;
  198.     *) echo "Usage: config.status --recheck" 2>&1; exit 1 ;;
  199.   esac
  200. done
  201.  
  202. trap 'rm -f Makefile; exit 1' 1 3 15
  203. CC='$CC'
  204. INSTALL='$INSTALL'
  205. INSTALL_PROGRAM='$INSTALL_PROGRAM'
  206. INSTALL_DATA='$INSTALL_DATA'
  207. LIBS='$LIBS'
  208. srcdir='$srcdir'
  209. DEFS='$DEFS'
  210. prefix='$prefix'
  211. exec_prefix='$exec_prefix'
  212. prsub='$prsub'
  213. EOF
  214. cat >> config.status <<\EOF
  215.  
  216. top_srcdir=$srcdir
  217. for file in .. Makefile; do if [ "x$file" != "x.." ]; then
  218.   srcdir=$top_srcdir
  219.   # Remove last slash and all that follows it.  Not all systems have dirname.
  220.   dir=`echo $file|sed 's%/[^/][^/]*$%%'`
  221.   if test "$dir" != "$file"; then
  222.     test "$top_srcdir" != . && srcdir=$top_srcdir/$dir
  223.     test ! -d $dir && mkdir $dir
  224.   fi
  225.   echo creating $file
  226.   rm -f $file
  227.   echo "# Generated automatically from `echo $file|sed 's|.*/||'`.in by configure." > $file
  228.   sed -e "
  229. $prsub
  230. s%@CC@%$CC%g
  231. s%@INSTALL@%$INSTALL%g
  232. s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
  233. s%@INSTALL_DATA@%$INSTALL_DATA%g
  234. s%@LIBS@%$LIBS%g
  235. s%@srcdir@%$srcdir%g
  236. s%@DEFS@%$DEFS%
  237. " $top_srcdir/${file}.in >> $file
  238. fi; done
  239.  
  240. EOF
  241. chmod +x config.status
  242. test -n "$no_create" || ./config.status
  243.  
  244.  
  245.